package com.zhentao.controller;

import com.zhentao.domain.YdOrganization;
import com.zhentao.domain.dto.IncomeAndPayItemDto;
import com.zhentao.service.YdAccountHeadService;
import com.zhentao.service.YdOrganizationService;
import com.zhentao.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;

/*
 *
 *  收支向明细
 *
 * */
@RestController
@RequestMapping("incomeAndPay")
public class IncomeAndPayItemController {

    @Autowired
    private YdOrganizationService ydOrganizationService;
    @Autowired
    private YdAccountHeadService ydAccountHeadService;

    //    收支项明细查询
    @PostMapping("incomeOrPayList")
    public Result IncomeOrPayList(@RequestBody IncomeAndPayItemDto dto) {
        return Result.success(ydAccountHeadService.IncomeOrPayList(dto));
    }
    //    收付款明细查询
    @PostMapping("rcvOrMakeList")
    public Result rcvOrMakeList(@RequestBody IncomeAndPayItemDto dto) {
        return Result.success(ydAccountHeadService.rcvOrMakeList(dto));
    }


    //    导出
    @GetMapping(value = "/exportData")
    public void exportData(HttpServletResponse response,@RequestBody IncomeAndPayItemDto dto) {
        ydAccountHeadService.exportData(response,dto);
    }

}
